﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SiteScan
{
    public partial class SetForm2 : Form
    {
        public SetForm2()
        {
            InitializeComponent();
        }

        //这是在子窗体中定义的属性。用来获取子窗体中的textbox值
        public TextBox getSetForm2Textbox1
        {
            get
            {
                return textBox1;
            }
        }
        public TextBox getSetForm2Textbox2
        {
            get
            {
                return textBox2;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialogFold = new FolderBrowserDialog();
            dialogFold.Description = "选择缓存文件保存的文件夹位置";
            dialogFold.SelectedPath = System.Environment.CurrentDirectory;
            if (dialogFold.ShowDialog() == DialogResult.OK)
            {
                string strCatchFold = dialogFold.SelectedPath;
                textBox1.Text = strCatchFold;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialogFile = new OpenFileDialog();
            dialogFile.InitialDirectory = System.Environment.CurrentDirectory;
            if (dialogFile.ShowDialog() == DialogResult.OK)
            {
                string strResultFile = dialogFile.FileName;
                textBox2.Text = strResultFile;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
        }
    }
}
